﻿// (c) Copyright Max Kazarin.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

/// <reference path='../Common/jquery-1.3.2.js' />
// <reference path='../Common/MicrosoftAjax.debug.js' />

Type.registerNamespace("jQueryNET.Data");

jQueryNET.Data.DataSourceBase = function jQueryNET$Data$DataSourceBase() {
	/// <summary>
	/// This class implement ComboBox control
	/// </summary>
	/// <param name='element' type='Sys.UI.DomElement' domElement='true'>
	/// DOM element the control is associated with
	/// </param>

	jQueryNET.Data.DataSourceBase.initializeBase(this);
}

function jQueryNET$Data$DataSourceBase$initialize() {
	/// <summary>
	/// Initialize the control
	/// </summary>

	jQueryNET.Data.DataSourceBase.callBaseMethod(this, "initialize");
}

function jQueryNET$Data$DataSourceBase$dispose() {
	/// <summary>
	/// Dispose the control
	/// </summary>

	jQueryNET.Data.DataSourceBase.callBaseMethod(this, "dispose");
}

function jQueryNET$Data$DataSourceBase$get_data() {
	if (arguments.length !== 0) throw Error.parameterCount();
	return this._data;
}

function jQueryNET$Data$DataSourceBase$fetch(params) {
}

function jQueryNET$Data$DataSourceBase$add_succeeded(handler) {
	/// <summary>
	/// Add an event handler for the succeeded event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().addHandler('succeeded', handler);
}

function jQueryNET$Data$DataSourceBase$remove_succeeded(handler) {
	/// <summary>
	/// Remove an event handler from the succeeded event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().removeHandler('succeeded', handler);
}

function jQueryNET$Data$DataSourceBase$raiseSucceeded(eventArgs) {
	/// <summary>
	/// Raise the succeeded event
	/// </summary>
	/// <param name='eventArgs' type='Sys.CancelEventArgs' mayBeNull='false'>
	/// Event arguments for the click event
	/// </param>
	/// <returns />

	var handler = this.get_events().getHandler('succeeded');
	if (handler) {
		handler(this, eventArgs);
	}
}

function jQueryNET$Data$DataSourceBase$add_failed(handler) {
	/// <summary>
	/// Add an event handler for the faild event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().addHandler('failed', handler);
}

function jQueryNET$Data$DataSourceBase$remove_failed(handler) {
	/// <summary>
	/// Remove an event handler from the faild event
	/// </summary>
	/// <param name='handler' type='Function' mayBeNull='false'>
	/// Event handler
	/// </param>
	/// <returns />

	this.get_events().removeHandler('failed', handler);
}

function jQueryNET$Data$DataSourceBase$raiseFailed(eventArgs) {
	/// <summary>
	/// Raise the faild event
	/// </summary>
	/// <param name='eventArgs' type='Sys.CancelEventArgs' mayBeNull='false'>
	/// Event arguments for the click event
	/// </param>
	/// <returns />

	var handler = this.get_events().getHandler('failed');
	if (handler) {
		handler(this, eventArgs);
	}
}

jQueryNET.Data.DataSourceBase.prototype = {
	_data: null,
	
	initialize: jQueryNET$Data$DataSourceBase$initialize,
	dispose: jQueryNET$Data$DataSourceBase$dispose,

	get_data: jQueryNET$Data$DataSourceBase$get_data,
	fetch: jQueryNET$Data$DataSourceBase$fetch,

	add_succeeded: jQueryNET$Data$DataSourceBase$add_succeeded,
	remove_succeeded: jQueryNET$Data$DataSourceBase$remove_succeeded,
	raiseSucceeded: jQueryNET$Data$DataSourceBase$raiseSucceeded,
	add_failed: jQueryNET$Data$DataSourceBase$add_failed,
	remove_failed: jQueryNET$Data$DataSourceBase$remove_failed,
	raiseFailed: jQueryNET$Data$DataSourceBase$raiseFailed
}

jQueryNET.Data.DataSourceBase.registerClass("jQueryNET.Data.DataSourceBase", Sys.Component);